package jinyilw.common.file;

import java.io.File;

public class TestTransfer implements Transfer
{
	private String fileName;
	public TestTransfer()
	{
	}

	@Override
	public void initStatus(String fileName, String fileSize, float percent)
	{
		this.fileName = fileName;
		System.out.println("开始传输：" + fileName + "，文件大小：" + fileSize);
		if (percent > 0)
			System.out
					.println(">正在传输：" + fileName + "[" + "进度：" + percent + "]");
	}

	@Override
	public void processStatus(float percent, String speed, String usedTime)
	{
		System.out.println(">正在传输：" + fileName + "[" + "进度：" + percent + "，速度："
				+ speed + "，用时：" + usedTime + "]");
	}

	@Override
	public void endStatus(File file, long fileLen, long transLen)
	{
		if (fileLen == transLen)
			System.out.println("传输完成：" + fileName);
		else
			System.err.println("传输异常：" + fileName);
	}
}
